10.1 TCP Operation  
  10.1.5 Sequencing numbers  
TCP breaks data into segments. The data segments are then transported from sender to receiver, following the synchronization process and the negotiation of a window size that dictates the number of bytes that can be transmitted at any one time. The data segments being transmitted must be reassembled once all the data is received. There is no guarantee that the data will arrive in the order it was transmitted. TCP applies sequence numbers to the data segments it is transmitting so that the receiver will be able to properly reassemble the bytes in their original order. If TCP segments arrive out of order, the segments may be reassembled incorrectly. Sequencing numbers indicate to the destination device the correct order in which to put the bytes when they are received.

These sequencing numbers also act as reference numbers so that the receiver will know if it has received all of the data. They also identify the missing data pieces to the sender so it can retransmit the missing data. This offers increased efficiency since the sender only needs to re-transmit the missing segments instead of the entire set of data.

Each TCP segment is numbered before transmission. Notice that following the destination port in the segment format is the sequence number portion. At the receiving station, TCP uses the sequence numbers to reassemble the segments into a complete message. If a sequence number is missing in the series, that segment is re-transmitted.